[IA64] Introduce dom0_vhpt_size_log2 boot option to change dom0 vhpt size
authorAlex Williamson <alex.williamson@hp.com>
Tue, 22 Jan 2008 15:26:20 +0000 (08:26 -0700)
committerAlex Williamson <alex.williamson@hp.com>
Tue, 22 Jan 2008 15:26:20 +0000 (08:26 -0700)
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
xen/arch/ia64/xen/dom0_ops.c
xen/arch/ia64/xen/vhpt.c
xen/arch/ia64/xen/xensetup.c
xen/include/asm-ia64/vhpt.h

index 56c23c7e0d8a5994db5ba6641735de22ba028cf0..85f8eaf7ee17a3e8f857f48348ac6fee8a7777e9 100644 (file)
@@ -20,6 +20,7 @@
 #include <xen/guest_access.h>
 #include <asm/vmx.h>
 #include <asm/dom_fw.h>
+#include <asm/vhpt.h>
 #include <xen/iocap.h>
 #include <xen/errno.h>
 #include <xen/nodemask.h>
@@ -121,20 +122,7 @@ long arch_do_domctl(xen_domctl_t *op, XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
                     for_each_vcpu (d, v)
                         v->arch.breakimm = d->arch.breakimm;
                 }
-#ifdef CONFIG_XEN_IA64_PERVCPU_VHPT
-                if (ds->vhpt_size_log2 == -1) {
-                    d->arch.has_pervcpu_vhpt = 0;
-                    ds->vhpt_size_log2 = -1;
-                    printk(XENLOG_INFO "XEN_DOMCTL_arch_setup: "
-                           "domain %d VHPT is global.\n", d->domain_id);
-                } else {
-                    d->arch.has_pervcpu_vhpt = 1;
-                    d->arch.vhpt_size_log2 = ds->vhpt_size_log2;
-                    printk(XENLOG_INFO "XEN_DOMCTL_arch_setup: "
-                           "domain %d VHPT is per vcpu. size=2**%d\n",
-                           d->domain_id, ds->vhpt_size_log2);
-                }
-#endif
+                domain_set_vhpt_size(d, ds->vhpt_size_log2);
                 if (ds->xsi_va)
                     d->arch.shared_info_va = ds->xsi_va;
                 ret = dom_fw_setup(d, ds->bp, ds->maxmem);
index aee9a833be06165e56f3767b1acdca39a80415f9..e5aac9aa435cc4994a2e216a9bb7a1352f1fcf9b 100644 (file)
@@ -153,6 +153,22 @@ void __init vhpt_init(void)
 }
 
 #ifdef CONFIG_XEN_IA64_PERVCPU_VHPT
+void
+domain_set_vhpt_size(struct domain *d, int8_t vhpt_size_log2)
+{
+       if (vhpt_size_log2 == -1) {
+               d->arch.has_pervcpu_vhpt = 0;
+               printk(XENLOG_INFO "XEN_DOMCTL_arch_setup: "
+                      "domain %d VHPT is global.\n", d->domain_id);
+       } else {
+               d->arch.has_pervcpu_vhpt = 1;
+               d->arch.vhpt_size_log2 = vhpt_size_log2;
+               printk(XENLOG_INFO "XEN_DOMCTL_arch_setup: "
+                      "domain %d VHPT is per vcpu. size=2**%d\n",
+                      d->domain_id, vhpt_size_log2);
+       }
+}
+
 int
 pervcpu_vhpt_alloc(struct vcpu *v)
 {
index 7673451195ad76234cb0df294d32d69e7073ffd3..ede498ababae748380eee43f79b01198c6daf237 100644 (file)
@@ -22,6 +22,7 @@
 #include <asm/meminit.h>
 #include <asm/page.h>
 #include <asm/setup.h>
+#include <asm/vhpt.h>
 #include <xen/string.h>
 #include <asm/vmx.h>
 #include <linux/efi.h>
@@ -329,6 +330,11 @@ is_platform_hp_ski(void)
     return 1;
 }
 
+#ifdef CONFIG_XEN_IA64_PERVCPU_VHPT
+static int __initdata dom0_vhpt_size_log2;
+integer_param("dom0_vhpt_size_log2", dom0_vhpt_size_log2);
+#endif
+
 void __init start_kernel(void)
 {
     char *cmdline;
@@ -630,6 +636,7 @@ printk("num_online_cpus=%d, max_cpus=%d\n",num_online_cpus(),max_cpus);
     dom0 = domain_create(0, 0, DOM0_SSIDREF);
     if (dom0 == NULL)
         panic("Error creating domain 0\n");
+    domain_set_vhpt_size(dom0, dom0_vhpt_size_log2);
     dom0_vcpu0 = alloc_vcpu(dom0, 0, 0);
     if (dom0_vcpu0 == NULL || vcpu_late_initialise(dom0_vcpu0) != 0)
         panic("Cannot allocate dom0 vcpu 0\n");
index 17703d365912d37c84497ce877ecfdbfdddff543..54b3bd8837d5bb86834f58221c4832fa26d94568 100644 (file)
@@ -55,8 +55,16 @@ DECLARE_PER_CPU (unsigned long, vhpt_pend);
 #endif
 
 #include <xen/sched.h>
+#ifdef CONFIG_XEN_IA64_PERVCPU_VHPT
+void domain_set_vhpt_size(struct domain *d, int8_t vhpt_size_log2);
 int pervcpu_vhpt_alloc(struct vcpu *v);
 void pervcpu_vhpt_free(struct vcpu *v);
+#else
+#define domain_set_vhpt_size(d, vhpt_size_log2) do { } while (0)
+#define pervcpu_vhpt_alloc(v)                   (0)
+#define pervcpu_vhpt_free(v)                    do { } while (0)
+#endif
+
 static inline unsigned long
 vcpu_vhpt_maddr(struct vcpu* v)
 {